import request from '@/utils/request'

// -------------------------------------------------------------------------------------出库管理接口文档----------------------------------------------------------------------------

// 获取预出库管理 和 出库管理 ，两个页面通用列表---------------------------------------- 
export function list (params) {
  return request({
    url: '/function/deliver/list',
    method: 'get',
    params
  })
}

// 预出库管理列表：删除接口---------------------------------------
export function deletelist (id) {
  return request({
    url: '/function/deliver/' + id,
    method: 'delete',
  })
}

// 预出库管理列表：确定出库接口---------------------------------------
export function resubmitPut (data) {
  return request({
    url: '/function/deliver/confirm',
    method: 'put',
    data
  })
}

// 获取出库单列表详情 ==> 三个页面,以及编辑全部通用 ----------------------------------------
export function listDetail (id) {
  return request({
    url: '/function/deliver/' + id,
    method: 'get',
  })
}

//开出库单：工单列表 => 获取工单编号列表----------------------------------------
export function equipmentList (params) {
  return request({
    url: '/function/pick/partInfo/list',
    method: 'get',
    params
  })
}

//开出库单：获取出库仓库列表----------------------------------------
export function replacementList (params) {
  return request({
    url: '/function/storehouse/list',
    method: 'get',
    params
  })
}

//开出库单==>添加物料【按钮】==>：获取备件耗材列表----------------------------------------
export function getuserlist (params) {
  return request({
    url: '/function/consumable/base/priceAndAmount/list',
    method: 'get',
    params
  })
}
//开出库单: 提交接口----------------------------------------
export function add (data) {
  return request({
    url: '/function/deliver',
    method: 'post',
    data
  })
}

// 开入库单:获取仓库列表，用于反向获取父级id---------------------------------------- 
export function RegionalList (params) {
  return request({
    url: '/function/storehouse/treeselect',
    method: 'get',
    params
  })
}

// 开出库单: 修改接口---------------------------------------- 
export function warehousingPut (data) {
  return request({
    url: '/function/deliver',
    method: 'put',
    data
  })
}
// ------------------------------------------------------------------------------------- 出库记录接口文档----------------------------------------------------------------------------

// 获取出库记录列表----------------------------------------
export function listRecord (params) {
  return request({
    url: '/function/deliver/consumable/list',
    method: 'get',
    params
  })
}
